<%@page language="java" pageEncoding="UTF-8"
	contentType="text/html; charset=UTF-8"%>
<%@ include file="/view/common/taglib.jsp"%>
<%@ include file="/view/common/variable.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%@ include file="/view/common/head.jsp"%>
<meta name="keywords" content="学而阅读,小说网,原创小说网" />
<meta name="description"
	content="学而阅读,最热门的免费小说网站,提供武侠仙侠,奇幻玄幻,科幻灵异,都市言情,穿越女频,青春校园,历史军事,网游竞技,职业官场等网络热门的书籍下载跟阅读！" />
<title>学而阅读作家后台</title>
<link rel="stylesheet" href="<%=path%>/css/style.css" />
<script type="text/javascript" src="<%=path%>/js/base.js"></script>
<script type="text/javascript">
	var defaultCover = 1;
	var bookId = 0;
	$(document).ready(function() {
		//设定为默认封面
		$('.imgtw li').on('click', function() {
			bomb();
			$(".mcover div span").html($(this).html());
			$(".mcover").fadeIn();
			defaultCover = $(this).val();
			bookId = $(this).attr('book-id');
		});
		//上传封面
		$('.uploadcover a').on('click', function() {
			bomb();
			$(".upcover").fadeIn();
		});

		//图片上传按钮
		$('.uploada a').on('click', function() {
			$(".upcover2").show();
			$(".upcover1").hide();

		});
		//图片上传按钮
		$('#yes').on('click', function() {
			bombhide();
			$(".mcover").hide();
			$.post("<%=path%>/book/updateDefCover", {
				bookId : bookId,
				defaultCover : defaultCover,
				lastPageNo:${page.pageNo}
			}, function(data, status) {
				var result = $.parseJSON(data);
				if (result.code == 0) {
					window.location.href = result.url;
				} else {
					alert(result.message);
				}
			});
		});
	});
	function uploadBookCover(bookId) {
		$('#bookId').val(bookId);
		bomb();
		$(".upcover").fadeIn();
	}
</script>
</head>

<body ng-app="myApp" ng-controller='ShowController'>
	<%@ include file="/view/common/header.jsp"%>
	<div class="content clearfix">
		<%@ include file="/view/common/left.jsp"%>
		<!--右边-->
		<div class="right r">
			<div class="path">
				作品管理 > <span>封面管理</span>
			</div>
			<div class="ny">
				<div class="cover">
					<table cellspacing="1" cellpadding="0" border="0" width="100%">
						<tr>
							<th>作品名／封面</th>
							<th width="170">封面状态</th>
							<th width="290">操作</th>
						</tr>
						<c:forEach items="${bookList}" var="book" varStatus="status">
							<tr>
								<td class="imgtw"><b><c:if
											test="${book.bookImageType==0}">
											<img src="${sourceUrl}/${book.bookImage}" />
										</c:if> <c:if test="${book.bookImageType==1}">
											<img src="${book.bookImage}" />
										</c:if></b>
									<div>
										<span>${book.bookName}</span>
										<ul>
											<li class="covero" value="1" book-id="${book.bookId}">默认封面一</li>
											<li value="2" book-id="${book.bookId}">默认封面二</li>
											<li value="3" book-id="${book.bookId}">默认封面三</li>
										</ul>
									</div></td>
								<td>正常</td>
								<td class="uploadcover" onclick="uploadBookCover('${book.bookId}');return false;"><a>上传封面</a></td>
							</tr>
						</c:forEach>
					</table>
				</div>
				<div>
					<page:page pageSize="${page.limit}" pageNo="${page.pageNo}"
						url="${path}/book/cover" recordCount="${recordCount}" />
				</div>
			</div>
		</div>
		<!--右边-->
	</div>

	<!--设定为默认封面-->
	<div class="mcover">
		<b>提 示</b>
		<div>
			要将此书封面设定为<span>默认封面一</span>？
		</div>
		<ul>
			<li id="no">否</li>
			<li id="yes">是</li>
		</ul>
	</div>
	<!--设定为默认封面-->
	<!--上传封面-->
	<div class="upcover">
		<div class="upcovers">
			上传封面<s><img src="<%=path%>/image/close.png" /></s>
		</div>

		<div class="upcover1">
			<form name="form" id="form" action="${path}/book/uploadCover"
				enctype="multipart/form-data" method="post">
				<input type="hidden" name="bookId" id="bookId" value="0" /> <input
					type="hidden" name="lastPageNo" id="lastPageNo"
					value="${page.pageNo}" /> <input type="hidden" name="opType"
					id="opType" value="book" />
				<div class="upcovern">
					<div class="upimgl">选择上传封面文件：</div>
					<span>浏 览<input type="file" name="fileContent"
						accept="image/*" /></span>
				</div>
				<input id="ajaxSubmit" type="submit" value="上传" />
			</form>

			<div class="upcoverx">
				<span>说明</span> 1、只能上传规格为250X335像素小于30KB的JPG图片。<br />
				2、禁止上传任何有色情、暴力、血腥、恐怖、广告宣传或者不适合公众欣赏的封面。<br />
				3、请使用原创图片，不得使用他人有版权的图片。<br /> 4、学而阅读有权将封面推荐给合作伙伴或做其他宣传使用，不另行通知。<br />
			</div>
		</div>

		<div class="upcover2">
			<div class="upsuccess">
				<b>上传成功！上传作品封面后，管理员将在1个工作日内审核完毕。</b> <a>关 闭</a>
			</div>
		</div>
	</div>
	<!--上传封面-->
</body>
</html>